<template>
	<view class="wrap">
		<view class="activity">
			<text class="activity_type">{{orderObj.activityType|activityType}}</text>
		</view>

		<view class="">
			<view class="content">
				<text class="title">状态</text>
				<text>{{orderObj.activityStatus|activityStatus}}</text>
			</view>
			<u-line></u-line>
		</view>

		<view class="">
			<view class="content">
				<text class="title">订单编号</text>
				<text>{{orderObj.orderNo}}</text>
			</view>
			<u-line></u-line>
		</view>

		<view class="">
			<view class="content">
				<text class="title">活动名称</text>
				<text>{{orderObj.activityName}}</text>
			</view>
			<u-line></u-line>
		</view>

		<view class="" v-if="orderObj.activityType ==3||orderObj.activityType ==4">
			<view class="content">
				<text class="title">奖品</text>
				<text>{{orderObj.prize}}</text>
			</view>
			<u-line></u-line>
		</view>

		<view class="bottomView">
			<view v-if="orderObj.activityType == 1">
				<text class="title">总金额</text>
				<text class="amount">¥{{orderObj.amount}}</text>
			</view>
			<view class="button" @click="goDetail">
				详情
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		name: 'activity-order-list',
		data() {
			return {}
		},
		props: {
			orderObj: {
				type: Object,
				default () {
					return {}
				}
			}
		},
		methods: {
			goDetail() {
				const activityType = this.orderObj.activityType;
				switch (activityType) {
					case 1: //秒杀
						uni.navigateTo({
							url: '/pagesB/activity/seckill/orderDetail-secondKill?orderNo=' + this.orderObj.orderNo
						})
						break;
					case 2: //集客
                         uni.navigateTo({
                         	url: '/pagesB/activity/gather/orderDetail-gather?orderNo=' + this.orderObj.orderNo
                         })
						break;
					case 3: //同行
						uni.navigateTo({
							url: '/pagesB/activity/peer/orderDetail-peer?orderNo=' + this.orderObj.orderNo
						})
						break;
					case 4: //抽奖
						uni.navigateTo({
							url: '/pagesB/activity/lucky/orderDetail-sweepstakes?orderNo=' + this.orderObj.orderNo
						})
						break;
					case 5: //权益卡
						uni.navigateTo({
							url: '/pagesB/activity/equity/equity-orderDetail?orderNo=' + this.orderObj.orderNo
						})
						break;
					default:
						break;
				}

			}
		},
	}
</script>

<style lang="scss" scoped>
	.wrap {
		background-color: #fff;
		border-radius: 18upx;
		margin: 20upx 45upx 0 45upx;
	}

	.activity {
		padding: 20upx;

		&_type {
			background-color: #FF9037;
			padding: 10upx;
			border-radius: 4upx;
			color: #fff;
			font-size: 24upx;
		}
	}


	.content {
		padding: 30upx 26upx;
		display: flex;
		justify-content: space-between;
	}


	.title {
		font-size: 28upx;
		font-family: PingFang SC, PingFang SC-Medium;
		text-align: left;
		color: #666666;
	}

	.amount {
		font-size: 28upx;
		font-family: PingFang SC, PingFang SC-Medium;
		font-weight: 500;
		text-align: left;
		color: #EC4863;
		margin-left: 10upx;
	}

	.bottomView {
		display: flex;
		height: 125upx;
		// justify-content: space-between;
		align-items: center;
		padding: 0upx 20upx;
		position: relative;

		.button {
			background-color: $main-color;
			padding: 18upx 60upx;
			color: #fff;
			font-size: 32upx;
			border-radius: 50upx;
			position: absolute;
			right: 20upx;

		}
	}
</style>
